package com.chance.cc.crawler.development.command.publish.eastMoney;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.eastmoney.searchKw.EastMoneySearchKwRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.eastmoney.searchKw.EastMoneySearchKwSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.eastmoney.searchKw.EastMoneySearchKwTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.domain.eastmoney.EastmoneyScheduleTrigger;

/**
 * @Author Zhao.Hhuan
 * @Date Create in 2020/12/10 15:36
 * @Description
 *      东方财富网
 **/
public class EastmoneyPublishCrawlerJob {
    private  static final String domain = "eastmoney";

    public static void main(String[] args) {
        publishSearchKwSimpleJob();

//        publishSearchKwRealtimeCronJob();
//        publishSearchKwTraceCronJob();

//        EastmoneyCrawlerScript.publishCrawlerNodeScript();
    }

    private static void publishSearchKwSimpleJob(){
        String node = "东方财富网关键词采集";
        CrawlerJob crawlerJob = EastMoneySearchKwSimpleCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        EastmoneyScheduleTrigger.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    private static void publishSearchKwRealtimeCronJob(){
        String node = "东方财富网关键词采集";
        CrawlerJob crawlerJob = EastMoneySearchKwRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        EastmoneyScheduleTrigger.realtimeCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    private static void publishSearchKwTraceCronJob(){
        String node = "东方财富网关键词采集";
        CrawlerJob crawlerJob = EastMoneySearchKwTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        EastmoneyScheduleTrigger.traceCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }
}
